package PrjHttpClt

import (
	"crypto/tls"
	"net"
	"net/http"
	"time"
)

func init() {
	http.DefaultClient.Timeout = time.Second * 120
	http.DefaultClient.Transport = &http.Transport{
		TLSClientConfig:       &tls.Config{InsecureSkipVerify: true}, //跳过证书的有效认证
		MaxIdleConns:          100,
		MaxIdleConnsPerHost:   2,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).DialContext,
	}
}
